<template>
  <div class="mv-top">
    <Header title="MV播放" go-back="true"></Header>
    <div class="video-box">
      <video :src="videoData" :poster="videoImage" controls="controls">
      </video>
      <div class="video-message">
        <h3>{{videoName}}</h3>
        <h4>{{author}}</h4>
      </div>
    </div>
  </div>
</template>

<script>
import Header from '../../Header/Header'
import {getMvData} from '../../../api/node'
import {loadMvCover} from '../../../api/storage'

export default {
  name: 'MVPLAY',
  data () {
    return {
      videoData: {}, // video路径
      videoName: '', // video名称
      author: '', // 作者
      videoImage: loadMvCover() // video没有播放时候的图片
    }
  },
  mounted () {
  },
  created () {
    getMvData(this.$route.params.id).then(res => {
      // console.log(res)
      if (res.code === 200) {
        this.videoData = res.data.brs[240] // 第一个视频链接
        this.videoName = res.data.name
        this.author = res.data.artistName
      }
    })
  },
  methods: {
  },
  components: {
    Header
  }
}
</script>

<style lang="scss" scoped>
.mv-top{
  width: 100%;
  padding-top: 50px;
  .video-box{
    width: 100%;
    video{
      width: 100%;
    }
    .video-js{
      width: 100%;
    }
    .video-message{
      width: 100%;
      padding: 10px;
      text-align: center;
      h3{
        font-size: 16px;
      }
      h4{
        font-size: 12px;
      }
    }
  }
}
</style>
